﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace PYS.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            PYSEntities dataContext = new PYSEntities();

            ViewBag.Message = "Orarul claselor de Steel Tonic ";
            ViewData.Model = dataContext.courses.ToList<course>();
            

            if(DateTime.Today.DayOfWeek.ToString() == "Sunday")
            {
                dataContext.ExecuteStoreCommand("Delete from vote");
                dataContext.ExecuteStoreCommand("Delete from result");
                dataContext.ExecuteStoreCommand("Delete from voteUsers");
            }

            return View();
        }
        
    }

}

 
